package com.situ.web.servlet;

import java.io.IOException;

import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class ServletContextServlet extends HttpServlet{
	@Override
	protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {		
		ServletContext servletContext = getServletContext();
		//a的路径
		String aPath = servletContext.getRealPath("/WEB-INF/classes/a.txt");
		System.out.println("aPath" + aPath);
		//b的路径
		String bPath = servletContext.getRealPath("/WEB-INF/b.txt");
		System.out.println("bPath" + bPath);
		//c的路径
		String cPath = servletContext.getRealPath("/c.txt");
		System.out.println("cPath" + cPath);
	}
}
